home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / RAVE.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  61.0 KB  |  1,528 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        RAVE.h
  3.  
  4.      Contains:    Interface for RAVE (Renderer Acceleration Virtual Engine)                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.6
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1995-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __RAVE__
  18. #define __RAVE__
  19.  
  20. #ifndef __CONDITIONALMACROS__
  21.     #include <ConditionalMacros.h>
  22. #endif
  23.  
  24.  
  25. #if TARGET_OS_MAC
  26. #ifndef __MACTYPES__
  27.     #include <MacTypes.h>
  28. #endif
  29.  
  30. #ifndef __QUICKDRAW__
  31.     #include <Quickdraw.h>
  32. #endif
  33.  
  34. #ifndef __QDOFFSCREEN__
  35.     #include <QDOffscreen.h>
  36. #endif
  37.  
  38.  
  39. #endif  /* TARGET_OS_MAC */
  40.  
  41. #if TARGET_OS_WIN32
  42. #include <windows.h>
  43. #ifndef RAVE_NO_DIRECTDRAW
  44. #include <ddraw.h>
  45. #endif  /* !defined(RAVE_NO_DIRECTDRAW) */
  46.  
  47. #endif  /* TARGET_OS_WIN32 */
  48.  
  49.  
  50.  
  51. #if PRAGMA_ONCE
  52. #pragma once
  53. #endif
  54.  
  55. #ifdef __cplusplus
  56. extern "C" {
  57. #endif
  58.  
  59. #if PRAGMA_IMPORT
  60. #pragma import on
  61. #endif
  62.  
  63. #if PRAGMA_STRUCT_ALIGN
  64.     #pragma options align=power
  65. #elif PRAGMA_STRUCT_PACKPUSH
  66.     #pragma pack(push, 2)
  67. #elif PRAGMA_STRUCT_PACK
  68.     #pragma pack(2)
  69. #endif
  70.  
  71. #if PRAGMA_ENUM_ALWAYSINT
  72.     #pragma enumsalwaysint on
  73. #elif PRAGMA_ENUM_OPTIONS
  74.     #pragma option enum=int
  75. #elif PRAGMA_ENUM_PACK
  76.     #if __option(pack_enums)
  77.         #define PRAGMA_ENUM_PACK__RAVE__
  78.     #endif
  79.     #pragma options(!pack_enums)
  80. #endif
  81.  
  82. #define RAVE_OBSOLETE 0
  83.  
  84. /******************************************************************************
  85.  *
  86.  * Platform macros.
  87.  * This sets kQAPlatform to one of kQAMacOS, kQAWin32, or kQAGeneric.
  88.  * kQAPlatform controls platform-specific compilation switches and types.
  89.  *
  90.  *****************************************************************************/
  91.  
  92. #if !defined(kQAMacOS)
  93. #define    kQAMacOS        1            /* Target is MacOS                    */
  94. #endif
  95.  
  96. #if !defined(kQAGeneric)
  97. #define kQAGeneric        2            /* Target is generic platform        */
  98. #endif
  99.  
  100. #if !defined(kQAWin32)
  101. #define kQAWin32        3            /* Target is Win32                    */
  102. #endif
  103.  
  104. #if defined(_WIN32) || defined(_WINDOWS)
  105.     #define kQAPlatform kQAWin32
  106. #elif !defined(kQAPlatform)
  107.     #define kQAPlatform kQAMacOS
  108. #endif
  109.  
  110.  
  111. /******************************************************************************
  112.  *
  113.  * Export Control
  114.  *
  115.  *****************************************************************************/
  116. #if defined(_MSC_VER)
  117.     /* Microsoft Visual C */
  118.     #if defined(WIN32_RAVEEXPORTING)    
  119.     /* define when building DLL */
  120.         #define    RAVE_EXPORT        __declspec( dllexport )
  121.         #define RAVE_CALL
  122.         #define RAVE_CALLBACK
  123.     #else
  124.         #define RAVE_EXPORT        __declspec( dllimport )
  125.         #define RAVE_CALL        __cdecl
  126.         #define RAVE_CALLBACK    __cdecl
  127.     #endif 
  128.     /* WIN32_RAVEEXPORTING */
  129. #else
  130.     #define RAVE_EXPORT
  131.     #define RAVE_CALL
  132.     #define RAVE_CALLBACK
  133. #endif 
  134. /* _MSC_VER */
  135.  
  136. /******************************************************************************
  137.  *
  138.  * Platform dependent datatypes: TQAImagePixelType, TQADevice, TQAClip, and TQARect.
  139.  *
  140.  *****************************************************************************/
  141.  
  142. enum TQAImagePixelType {
  143.     kQAPixel_Alpha1                = 0,                            /* 1 bit/pixel alpha */
  144.     kQAPixel_RGB16                = 1,                            /* 16 bits/pixel, R=14:10, G=9:5, B=4:0 */
  145.     kQAPixel_ARGB16                = 2,                            /* 16 bits/pixel, A=15, R=14:10, G=9:5, B=4:0 */
  146.     kQAPixel_RGB32                = 3,                            /* 32 bits/pixel, R=23:16, G=15:8, B=7:0 */
  147.     kQAPixel_ARGB32                = 4,                            /* 32 bits/pixel, A=31:24, R=23:16, G=15:8, B=7:0 */
  148.     kQAPixel_CL4                = 5,                            /* 4 bit color look up table, always big endian, ie high 4 bits effect left pixel */
  149.     kQAPixel_CL8                = 6,                            /* 8 bit color look up table */
  150.     kQAPixel_RGB16_565            = 7,                            /* Win32 ONLY  16 bits/pixel, no alpha, R:5, G:6, B:5 */
  151.     kQAPixel_RGB24                = 8,                            /* Win32 ONLY  24 bits/pixel, no alpha, R:8, G:8, B:8 */
  152.     kQAPixel_RGB8_332            = 9,                            /* 8 bits/pixel, R=7:5, G = 4:2, B = 1:0 */
  153.     kQAPixel_ARGB16_4444        = 10,                            /* 16 bits/pixel, A=15:12, R=11:8, G=7:4, B=3:0 */
  154.     kQAPixel_ACL16_88            = 11,                            /* 16 bits/pixel, A=15:8, CL=7:0, 8 bit alpha + 8 bit color lookup */
  155.     kQAPixel_I8                    = 12,                            /* 8 bits/pixel, I=7:0, intensity map (grayscale) */
  156.     kQAPixel_AI16_88            = 13,                            /* 16 bits/pixel, A=15:8, I=7:0, intensity map (grayscale) */
  157.     kQAPixel_YUVS                = 14,                            /* 16 bits/pixel, QD's kYUVSPixelFormat (4:2:2, YUYV ordering, unsigned UV) */
  158.     kQAPixel_YUVU                = 15,                            /* 16 bits/pixel, QD's kYUVUPixelFormat (4:2:2, YUYV ordering, signed UV) */
  159.     kQAPixel_YVYU422            = 16,                            /* 16 bits/pixel, QD's kYVYU422PixelFormat (4:2:2, YVYU ordering, unsigned UV) */
  160.     kQAPixel_UYVY422            = 17                            /* 16 bits/pixel, QD's kUYVY422PixelFormat (4:2:2, UYVY ordering, unsigned UV) */
  161. };
  162. typedef enum TQAImagePixelType TQAImagePixelType;
  163.  
  164.  
  165. enum TQAColorTableType {
  166.     kQAColorTable_CL8_RGB32        = 0,                            /* 256 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0 */
  167.     kQAColorTable_CL4_RGB32        = 1                                /* 16 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0 */
  168. };
  169. typedef enum TQAColorTableType TQAColorTableType;
  170.  
  171. /* Selects target device type */
  172.  
  173. enum TQADeviceType {
  174.     kQADeviceMemory                = 0,                            /* Memory draw context */
  175.     kQADeviceGDevice            = 1,                            /* Macintosh GDevice draw context */
  176.     kQADeviceWin32DC            = 2,                            /* Win32 DC */
  177.     kQADeviceDDSurface            = 3                                /* Win32 DirectDraw Surface */
  178. };
  179. typedef enum TQADeviceType TQADeviceType;
  180.  
  181. /* Generic memory pixmap device */
  182.  
  183. struct TQADeviceMemory {
  184.     long                             rowBytes;                    /* Rowbytes */
  185.     TQAImagePixelType                 pixelType;                    /* Depth, color space, etc. */
  186.     long                             width;                        /* Width in pixels */
  187.     long                             height;                        /* Height in pixels */
  188.     void *                            baseAddr;                    /* Base address of pixmap */
  189. };
  190. typedef struct TQADeviceMemory            TQADeviceMemory;
  191. /* Offscreen Device */
  192.  
  193. struct TQADeviceOffscreen {
  194.     TQAImagePixelType                 pixelType;                    /* Depth, color space, etc. */
  195. };
  196. typedef struct TQADeviceOffscreen        TQADeviceOffscreen;
  197. /* Selects target clip type */
  198.  
  199. enum TQAClipType {
  200.     kQAClipRgn                    = 0,                            /* Macintosh clipRgn with serial number */
  201.     kQAClipWin32Rgn                = 1                                /* Win32 clip region */
  202. };
  203. typedef enum TQAClipType TQAClipType;
  204.  
  205.  
  206. struct TQARect {
  207.     long                             left;
  208.     long                             right;
  209.     long                             top;
  210.     long                             bottom;
  211. };
  212. typedef struct TQARect                    TQARect;
  213. #if TARGET_OS_MAC
  214.  
  215. union TQAPlatformDevice {
  216.     TQADeviceMemory                 memoryDevice;
  217.     GDHandle                         gDevice;
  218. };
  219. typedef union TQAPlatformDevice            TQAPlatformDevice;
  220.  
  221. union TQAPlatformClip {
  222.     RgnHandle                         clipRgn;
  223. };
  224. typedef union TQAPlatformClip            TQAPlatformClip;
  225. typedef CALLBACK_API( void , TQADrawNotificationProcPtr )(short left, short top, short right, short bottom, long refCon);
  226.  
  227. typedef long                             TQADrawNotificationProcRefNum;
  228. /* used to unregister your proc */
  229. #elif TARGET_OS_WIN32
  230.  
  231. #if !defined(RAVE_NO_DIRECTDRAW)
  232.  
  233.     enum TQADirectDrawObjectSelector
  234.     {
  235.         kQADirectDrawObject        = 1,
  236.         kQADirectDrawObject2    = 2
  237.     };
  238.     typedef enum TQADirectDrawObjectSelector TQADirectDrawObjectSelector;
  239.  
  240.     enum TQADirectDrawSurfaceSelector
  241.     {
  242.         kQADirectDrawSurface    = 1,
  243.         kQADirectDrawSurface2    = 2
  244.     };
  245.     typedef enum TQADirectDrawSurfaceSelector TQADirectDrawSurfaceSelector;
  246.  
  247. #endif /* !RAVE_NO_DIRECTDRAW */
  248.  
  249.     union TQAPlatformDevice
  250.     {
  251.         TQADeviceMemory            memoryDevice;
  252.         HDC                        hdc;
  253. #if !defined(RAVE_NO_DIRECTDRAW)
  254.         struct
  255.         {
  256.             TQADirectDrawObjectSelector        objectSelector;
  257.             union
  258.             {
  259.                 LPDIRECTDRAW                lpDirectDraw;
  260.                 LPDIRECTDRAW2                lpDirectDraw2;
  261.             };
  262.  
  263.             TQADirectDrawSurfaceSelector    surfaceSelector;
  264.             union
  265.             {
  266.                 LPDIRECTDRAWSURFACE            lpDirectDrawSurface;
  267.                 LPDIRECTDRAWSURFACE2        lpDirectDrawSurface2;
  268.             };
  269.         };
  270. #endif /* RAVE_NO_DIRECTDRAW */
  271.     };
  272.     typedef union TQAPlatformDevice TQAPlatformDevice;
  273.     
  274.     union TQAPlatformClip
  275.     {
  276.         HRGN            clipRgn;
  277.     };
  278.     typedef union TQAPlatformClip TQAPlatformClip;
  279.  
  280. #else
  281. /*
  282.      * Generic platform supports memory device only. TQARect is generic. TQAClip is ???.
  283.      */
  284.  
  285. union TQAPlatformDevice {
  286.     TQADeviceMemory                 memoryDevice;
  287. };
  288. typedef union TQAPlatformDevice            TQAPlatformDevice;
  289.  
  290. union TQAPlatformClip {
  291.     void *                            region;                        /* ??? */
  292. };
  293. typedef union TQAPlatformClip            TQAPlatformClip;
  294. #endif  /*  */
  295.  
  296.  
  297. struct TQADevice {
  298.     TQADeviceType                     deviceType;
  299.     TQAPlatformDevice                 device;
  300. };
  301. typedef struct TQADevice                TQADevice;
  302.  
  303. struct TQAClip {
  304.     TQAClipType                     clipType;
  305.     TQAPlatformClip                 clip;
  306. };
  307. typedef struct TQAClip                    TQAClip;
  308. /******************************************************************************
  309.  *
  310.  * Basic data types.
  311.  *
  312.  *****************************************************************************/
  313.  
  314. /* Pointer to a drawing engine */
  315. typedef struct TQAEngine TQAEngine;
  316. /* Pointer to an allocated texture */
  317. typedef struct TQATexture TQATexture;
  318. /* Pointer to an allocated bitmap */
  319. typedef struct TQABitmap TQABitmap;
  320. /* Engine's private draw context pointer */
  321. typedef struct TQADrawPrivate TQADrawPrivate;
  322. /* An engine specific color table structure */
  323. typedef struct TQAColorTable TQAColorTable;
  324. /* A single triangle element for QADrawTriMesh */
  325.  
  326. struct TQAIndexedTriangle {
  327.     unsigned long                     triangleFlags;                /* Triangle flags, see kQATriFlags_ */
  328.     unsigned long                     vertices[3];                /* Indices into a vertex array */
  329. };
  330. typedef struct TQAIndexedTriangle        TQAIndexedTriangle;
  331. /* An image for use as texture or bitmap */
  332.  
  333. struct TQAImage {
  334.     long                             width;                        /* Width of pixmap */
  335.     long                             height;                        /* Height of pixmap */
  336.     long                             rowBytes;                    /* Rowbytes of pixmap */
  337.     void *                            pixmap;                        /* Pixmap */
  338. };
  339. typedef struct TQAImage                    TQAImage;
  340. /* a pixel buffer */
  341.  
  342. typedef TQADeviceMemory                 TQAPixelBuffer;
  343. /* a zbuffer */
  344.  
  345. struct TQAZBuffer {
  346.     long                             width;                        /* Width of pixmap */
  347.     long                             height;                        /* Height of pixmap */
  348.     long                             rowBytes;                    /* Rowbytes of pixmap */
  349.     void *                            zbuffer;                    /* pointer to the zbuffer data */
  350.     long                             zDepth;                        /* bit depth of zbuffer (16,24,32...) */
  351.     long                             isBigEndian;                /* true if zbuffer values are in big-endian format, false if little-endian */
  352. };
  353. typedef struct TQAZBuffer                TQAZBuffer;
  354. /* Standard error type */
  355.  
  356. enum TQAError {
  357.     kQANoErr                    = 0,                            /* No error */
  358.     kQAError                    = 1,                            /* Generic error flag */
  359.     kQAOutOfMemory                = 2,                            /* Insufficient memory */
  360.     kQANotSupported                = 3,                            /* Requested feature is not supported */
  361.     kQAOutOfDate                = 4,                            /* A newer drawing engine was registered */
  362.     kQAParamErr                    = 5,                            /* Error in passed parameters */
  363.     kQAGestaltUnknown            = 6,                            /* Requested gestalt type isn't available */
  364.     kQADisplayModeUnsupported    = 7,                            /* Engine cannot render to the display in its current , */
  365.                                                                 /* mode, but could if it were in some other mode */
  366.     kQAOutOfVideoMemory            = 8                                /* There is not enough VRAM to support the desired context dimensions */
  367. };
  368. typedef enum TQAError TQAError;
  369.  
  370. /* TQABoolean */
  371.  
  372. typedef unsigned char                     TQABoolean;
  373. /************************************************************************************************
  374.  *
  375.  * Vertex data types.
  376.  *
  377.  ***********************************************************************************************/
  378. /*
  379.  * TQAVGouraud is used for Gouraud shading. Each vertex specifies position, color and Z.
  380.  *
  381.  * Alpha is always treated as indicating transparency. Drawing engines which don't
  382.  * support Z-sorted rendering use the back-to-front transparency blending functions
  383.  * shown below. (ARGBsrc are the source (new) values, ARGBdest are  the destination
  384.  * (previous) pixel values.)
  385.  *
  386.  *        Premultiplied                            Interpolated
  387.  *
  388.  *        A = 1 - (1 - Asrc) * (1 - Adest)        A = 1 - (1 - Asrc) * (1 - Adest) 
  389.  *        R = (1 - Asrc) * Rdest + Rsrc            R = (1 - Asrc) * Rdest + Asrc * Rsrc
  390.  *        G = (1 - Asrc) * Gdest + Gsrc            G = (1 - Asrc) * Gdest + Asrc * Gsrc
  391.  *        B = (1 - Asrc) * Bdest + Bsrc            B = (1 - Asrc) * Bdest + Asrc * Bsrc
  392.  *
  393.  * Note that the use of other blending modes to implement antialiasing is performed
  394.  * automatically by the drawing engine when the kQATag_Antialias variable !=
  395.  * kQAAntiAlias_Fast. The driving software should continue to use the alpha fields
  396.  * for transparency even when antialiasing is being used (the drawing engine will
  397.  * resolve the multiple blending requirements as best as it can).
  398.  *
  399.  * Drawing engines which perform front-to-back Z-sorted rendering should replace
  400.  * the blending function shown above with the equivalent front-to-back formula.
  401.  */
  402.  
  403. struct TQAVGouraud {
  404.     float                             x;                            /* X pixel coordinate, 0.0 <= x < width */
  405.     float                             y;                            /* Y pixel coordinate, 0.0 <= y < height */
  406.     float                             z;                            /* Z coordinate, 0.0 <= z <= 1.0 */
  407.     float                             invW;                        /* 1 / w; required only when kQAPerspectiveZ_On is set */
  408.  
  409.     float                             r;                            /* Red, 0.0 <= r <= 1.0 */
  410.     float                             g;                            /* Green, 0.0 <= g <= 1.0 */
  411.     float                             b;                            /* Blue, 0.0 <= b <= 1.0 */
  412.     float                             a;                            /* Alpha, 0.0 <= a <= 1.0, 1.0 is opaque */
  413. };
  414. typedef struct TQAVGouraud                TQAVGouraud;
  415. /*
  416.  * TQAVTexture is used for texture mapping. The texture mapping operation
  417.  * is controlled by the kQATag_TextureOp variable, which is a mask of
  418.  * kQATextureOp_None/Modulate/Highlight/Decal. Below is pseudo-code for the
  419.  * texture shading operation:
  420.  *
  421.  *        texPix = TextureLookup (uq/q, vq/q);
  422.  *        if (kQATextureOp_Decal)
  423.  *        {
  424.  *            texPix.r = texPix.a * texPix.r + (1 - texPix.a) * r;
  425.  *            texPix.g = texPix.a * texPix.g + (1 - texPix.a) * g;
  426.  *            texPix.b = texPix.a * texPix.b + (1 - texPix.a) * b;
  427.  *            texPix.a = a;
  428.  *        }
  429.  *        else
  430.  *        {
  431.  *            texPix.a = texPix.a * a;
  432.  *        }
  433.  *        if (kQATextureOp_Modulate)
  434.  *        {
  435.  *            texPix.r *= kd_r;        // Clamped to prevent overflow
  436.  *            texPix.g *= kd_g;        // Clamped to prevent overflow
  437.  *            texPix.b *= kd_b;        // Clamped to prevent overflow
  438.  *        }
  439.  *        if (kQATextureOp_Highlight)
  440.  *        {
  441.  *            texPix.r += ks_r;        // Clamped to prevent overflow
  442.  *            texPix.g += ks_g;        // Clamped to prevent overflow
  443.  *            texPix.b += ks_b;        // Clamped to prevent overflow
  444.  *        }
  445.  *
  446.  * After computation of texPix, transparency blending (as shown
  447.  * above for TQAVGouraud) is performed.
  448.  */
  449.  
  450. struct TQAVTexture {
  451.     float                             x;                            /* X pixel coordinate, 0.0 <= x < width */
  452.     float                             y;                            /* Y pixel coordinate, 0.0 <= y < height */
  453.     float                             z;                            /* Z coordinate, 0.0 <= z <= 1.0 */
  454.     float                             invW;                        /* 1 / w (always required) */
  455.  
  456.                                                                 /* rgb are used only when kQATextureOp_Decal is set. a is always required */
  457.  
  458.     float                             r;                            /* Red, 0.0 <= r <= 1.0 */
  459.     float                             g;                            /* Green, 0.0 <= g <= 1.0 */
  460.     float                             b;                            /* Blue, 0.0 <= b <= 1.0 */
  461.     float                             a;                            /* Alpha, 0.0 <= a <= 1.0, 1.0 is opaque */
  462.  
  463.                                                                 /* uOverW and vOverW are required by all modes */
  464.  
  465.     float                             uOverW;                        /* u / w */
  466.     float                             vOverW;                        /* v / w */
  467.  
  468.                                                                 /* kd_r/g/b are used only when kQATextureOp_Modulate is set */
  469.  
  470.     float                             kd_r;                        /* Scale factor for texture red, 0.0 <= kd_r */
  471.     float                             kd_g;                        /* Scale factor for texture green, 0.0 <= kd_g */
  472.     float                             kd_b;                        /* Scale factor for texture blue, 0.0 <= kd_b */
  473.  
  474.                                                                 /* ks_r/g/b are used only when kQATextureOp_Highlight is set */
  475.  
  476.     float                             ks_r;                        /* Red specular highlight, 0.0 <= ks_r <= 1.0 */
  477.     float                             ks_g;                        /* Green specular highlight, 0.0 <= ks_g <= 1.0 */
  478.     float                             ks_b;                        /* Blue specular highlight, 0.0 <= ks_b <= 1.0 */
  479. };
  480. typedef struct TQAVTexture                TQAVTexture;
  481. /*
  482. *  TQAVMultiTexture allows you to specify the uv and invW values
  483. *  for secondary textures.  This data is submitted with the
  484. *  QASubmitMultiTextureParams() call.
  485. */
  486.  
  487. struct TQAVMultiTexture {
  488.     float                             invW;
  489.     float                             uOverW;
  490.     float                             vOverW;
  491. };
  492. typedef struct TQAVMultiTexture            TQAVMultiTexture;
  493.  
  494. /************************************************************************************************
  495.  *
  496.  * Constants used for the state variables.
  497.  *
  498.  ***********************************************************************************************/
  499. /*
  500.  * kQATag_xxx is used to select a state variable when calling QASetFloat(), QASetInt(),
  501.  * QAGetFloat() and QAGetInt(). The kQATag values are split into three separate enumerated
  502.  * types: TQATagInt, TQATagPtr and TQATagFloat. TQATagInt is used for the QASet/GetInt()
  503.  * functions, TQATagPtr is used for the QASet/GetPtr() functions, and TQATagFloat is used for 
  504.  * the QASet/GetFloat() functions. (This is so that a compiler that typechecks enums can flag
  505.  * a float/int tag mismatch during compile.)
  506.  *
  507.  * -=- All tag values must be unique even across all three types. -=-
  508.  *
  509.  * These variables are required by all drawing engines:
  510.  *        kQATag_ZFunction            (Int)    One of kQAZFunction_xxx
  511.  *        kQATag_ColorBG_a            (Float)    Background color alpha
  512.  *        kQATag_ColorBG_r            (Float)    Background color red
  513.  *        kQATag_ColorBG_g            (Float)    Background color green
  514.  *        kQATag_ColorBG_b            (Float)    Background color blue
  515.  *        kQATag_Width                (Float)    Line and point width (pixels)
  516.  *        kQATag_ZMinOffset            (Float)    Min offset to Z to guarantee visibility (Read only!)
  517.  *        kQATag_ZMinScale            (Float)    Min scale to Z to guarantee visibility (Read only!)
  518.  
  519.  * These variables are used for optional features:
  520.  *        kQATag_Antialias            (Int)    One of kQAAntiAlias_xxx
  521.  *        kQATag_Blend                (Int)    One of kQABlend_xxx
  522.  *        kQATag_PerspectiveZ            (Int)    One of kQAPerspectiveZ_xxx
  523.  *        kQATag_TextureFilter        (Int)    One of kQATextureFilter_xxx
  524.  *        kQATag_TextureOp            (Int)    Mask of kQATextureOp_xxx
  525.  *        kQATag_Texture                (Ptr)    Pointer to current TQATexture
  526.  *        kQATag_CSGTag                (Int)    One of kQACSGTag_xxx
  527.  *        kQATag_CSGEquation            (Int)    32 bit CSG truth table
  528.  *        kQATag_FogMode                (Int)   One of kQAFogMode_xxxx
  529.  *        kQATag_FogColor_a            (Float) Fog color alpha
  530.  *        kQATag_FogColor_r            (Float) Fog color red
  531.  *        kQATag_FogColor_g            (Float) Fog color green
  532.  *        kQATag_FogColor_b            (Float) Fog color blue
  533.  *        kQATag_FogStart                (Float) Fog start
  534.  *        kQATag_FogEnd                (Float) Fog end
  535.  *        kQATag_FogDensity            (Float) Fog density
  536.  *        kQATag_FogMaxDepth            (Float) Maximun value for 1.0 / invW
  537.  *        kQATag_MipmapBias             (Float) The mipmap page bias factor
  538.  *        kQATag_ChannelMask            (Int) one of kQAChannelMask_xxx
  539.  *        kQATag_ZBufferMask            (Int) one of kQAZBufferMask_xxx
  540.  *        kQATag_ZSortedHint            (Int) 1 = depth sort transparent triangles, 0 = do not sort.
  541.  *        kQATag_Chromakey_r            (Float) chroma key red
  542.  *        kQATag_Chromakey_g            (Float) chroma key green
  543.  *        kQATag_Chromakey_b            (Float) chroma key blue
  544.  *        kQATag_ChromakeyEnable        (Int) 1 = enable chroma keying, 0 = disable chroma keying
  545.  *        kQATag_AlphaTestFunc        (Int) one of kQAAlphaTest_xxx
  546.  *        kQATag_AlphaTestRef            (Float) from 0 to 1
  547.  *        kQATag_DontSwap                (Int) 1 = dont swap buffers during QARenderEnd, 0 = do swap buffers during QARenderEnd.
  548.  
  549.  *      kQATag_MultiTextureOp       (Int) One of kQAMultiTexture_xxx
  550.  *        kQATag_MultiTextureFilter   (Int) One of kQATextureFilter_xxx
  551.  *        kQATag_MultiTextureCurrent    (Int) which multitexture layer to use for all other multitexture funcs
  552.  *        kQATag_MultiTextureEnable    (Int) how many multitexture layers to use (0 = no multitexturing).
  553.  *        kQATag_MultiTextureWrapU    (Int)
  554.  *        kQATag_MultiTextureWrapV    (Int)
  555.  *        kQATag_MultiTextureMagFilter (Int)
  556.  *        kQATag_MultiTextureMinFilter (Int)
  557.  *        kQATag_MultiTextureBorder_a    (Float)
  558.  *        kQATag_MultiTextureBorder_r    (Float)
  559.  *        kQATag_MultiTextureBorder_g    (Float)
  560.  *        kQATag_MultiTextureBorder_b    (Float)
  561.  *        kQATag_MultiTextureMipmapBias (Float)
  562.  *        kQATag_MultiTextureFactor     (Float) used with kQAMultiTexture_Fixed to determine blending factor
  563.  *
  564.  * These variables are used for OpenGL(tm) support:
  565.  *        kQATagGL_DrawBuffer            (Int)    Mask of kQAGL_DrawBuffer_xxx
  566.  *        kQATagGL_TextureWrapU        (Int)    kQAGL_Clamp or kQAGL_Repeat
  567.  *        kQATagGL_TextureWrapV        (Int)    kQAGL_Clamp or kQAGL_Repeat
  568.  *        kQATagGL_TextureMagFilter    (Int)    kQAGL_Nearest or kQAGL_Linear
  569.  *        kQATagGL_TextureMinFilter    (Int)    kQAGL_Nearest, etc.
  570.  *        kQATagGL_ScissorXMin        (Int)    Minimum X value for scissor rectangle
  571.  *        kQATagGL_ScissorYMin        (Int)    Minimum Y value for scissor rectangle
  572.  *        kQATagGL_ScissorXMax        (Int)    Maximum X value for scissor rectangle
  573.  *        kQATagGL_ScissorYMax        (Int)    Maximum Y value for scissor rectangle
  574.  *        kQATagGL_BlendSrc            (Int)    Source blending operation
  575.  *        kQATagGL_BlendDst            (Int)    Destination blending operation
  576.  *        kQATagGL_LinePattern        (Int)    Line rasterization pattern
  577.  *        kQATagGL_AreaPattern0        (Int)    First of 32 area pattern registers
  578.  *        kQATagGL_AreaPattern31        (Int)    Last of 32 area pattern registers
  579.  *
  580.  *        kQATagGL_DepthBG            (Float)    Background Z
  581.  *        kQATagGL_TextureBorder_a    (Float)    Texture border color alpha
  582.  *        kQATagGL_TextureBorder_r    (Float)    Texture border color red
  583.  *        kQATagGL_TextureBorder_g    (Float)    Texture border color green
  584.  *        kQATagGL_TextureBorder_b    (Float)    Texture border color blue
  585.  *
  586.  * Tags >= kQATag_EngineSpecific_Minimum may be assigned by the vendor for use as
  587.  * engine-specific variables. NOTE: These should be used only in exceptional circumstances,
  588.  * as functions performed by these variables won't be generally accessible. All other tag
  589.  * values are reserved.
  590.  *
  591.  *        kQATag_EngineSpecific_Minimum    Minimum tag value for drawing-engine specific variables
  592.  */
  593.  
  594. enum TQATagInt {
  595.     kQATag_ZFunction            = 0,
  596.     kQATag_Antialias            = 8,
  597.     kQATag_Blend                = 9,
  598.     kQATag_PerspectiveZ            = 10,
  599.     kQATag_TextureFilter        = 11,
  600.     kQATag_TextureOp            = 12,
  601.     kQATag_CSGTag                = 14,
  602.     kQATag_CSGEquation            = 15,
  603.     kQATag_BufferComposite        = 16,
  604.     kQATag_FogMode                = 17,
  605.     kQATag_ChannelMask            = 27,
  606.     kQATag_ZBufferMask            = 28,
  607.     kQATag_ZSortedHint            = 29,
  608.     kQATag_ChromakeyEnable        = 30,
  609.     kQATag_AlphaTestFunc        = 31,
  610.     kQATag_DontSwap                = 32,
  611.     kQATag_MultiTextureEnable    = 33,
  612.     kQATag_MultiTextureCurrent    = 34,
  613.     kQATag_MultiTextureOp        = 35,
  614.     kQATag_MultiTextureFilter    = 36,
  615.     kQATag_MultiTextureWrapU    = 37,
  616.     kQATag_MultiTextureWrapV    = 38,
  617.     kQATag_MultiTextureMagFilter = 39,
  618.     kQATag_MultiTextureMinFilter = 40,
  619.     kQATag_BitmapFilter            = 54,                            /* filter to use while scaling bitmaps, one of kQAFilter_xxx */
  620.     kQATag_DrawContextFilter    = 55,                            /* filter to use while scaling draw contexts, one of kQAFilter_xxx */
  621.     kQATagGL_DrawBuffer            = 100,
  622.     kQATagGL_TextureWrapU        = 101,
  623.     kQATagGL_TextureWrapV        = 102,
  624.     kQATagGL_TextureMagFilter    = 103,
  625.     kQATagGL_TextureMinFilter    = 104,
  626.     kQATagGL_ScissorXMin        = 105,
  627.     kQATagGL_ScissorYMin        = 106,
  628.     kQATagGL_ScissorXMax        = 107,
  629.     kQATagGL_ScissorYMax        = 108,
  630.     kQATagGL_BlendSrc            = 109,
  631.     kQATagGL_BlendDst            = 110,
  632.     kQATagGL_LinePattern        = 111,
  633.     kQATagGL_AreaPattern0        = 117,                            /* ...kQATagGL_AreaPattern1-30 */
  634.     kQATagGL_AreaPattern31        = 148,
  635.     kQATagGL_LinePatternFactor    = 149,                            /* equivalent to GL_LINE_STIPPLE_REPEAT */
  636.     kQATag_EngineSpecific_Minimum = 1000
  637. };
  638. typedef enum TQATagInt TQATagInt;
  639.  
  640.  
  641. enum TQATagPtr {
  642.     kQATag_Texture                = 13,
  643.     kQATag_MultiTexture            = 26
  644. };
  645. typedef enum TQATagPtr TQATagPtr;
  646.  
  647.  
  648. enum TQATagFloat {
  649.     kQATag_ColorBG_a            = 1,
  650.     kQATag_ColorBG_r            = 2,
  651.     kQATag_ColorBG_g            = 3,
  652.     kQATag_ColorBG_b            = 4,
  653.     kQATag_Width                = 5,
  654.     kQATag_ZMinOffset            = 6,
  655.     kQATag_ZMinScale            = 7,
  656.     kQATag_FogColor_a            = 18,
  657.     kQATag_FogColor_r            = 19,
  658.     kQATag_FogColor_g            = 20,
  659.     kQATag_FogColor_b            = 21,
  660.     kQATag_FogStart                = 22,
  661.     kQATag_FogEnd                = 23,
  662.     kQATag_FogDensity            = 24,
  663.     kQATag_FogMaxDepth            = 25,
  664.     kQATag_MipmapBias            = 41,
  665.     kQATag_MultiTextureMipmapBias = 42,
  666.     kQATag_Chromakey_r            = 43,
  667.     kQATag_Chromakey_g            = 44,
  668.     kQATag_Chromakey_b            = 45,
  669.     kQATag_AlphaTestRef            = 46,
  670.     kQATag_MultiTextureBorder_a    = 47,
  671.     kQATag_MultiTextureBorder_r    = 48,
  672.     kQATag_MultiTextureBorder_g    = 49,
  673.     kQATag_MultiTextureBorder_b    = 50,
  674.     kQATag_MultiTextureFactor    = 51,
  675.     kQATag_BitmapScale_x        = 52,                            /* horizontal bitmap scale factor, default value is 1.0 */
  676.     kQATag_BitmapScale_y        = 53,                            /* vertical bitmap scale factor, default value is 1.0 */
  677.     kQATag_MultiTextureEnvColor_a = 56,
  678.     kQATag_MultiTextureEnvColor_r = 57,
  679.     kQATag_MultiTextureEnvColor_g = 58,
  680.     kQATag_MultiTextureEnvColor_b = 59,
  681.     kQATagGL_DepthBG            = 112,
  682.     kQATagGL_TextureBorder_a    = 113,
  683.     kQATagGL_TextureBorder_r    = 114,
  684.     kQATagGL_TextureBorder_g    = 115,
  685.     kQATagGL_TextureBorder_b    = 116,
  686.     kQATagGL_TextureEnvColor_a    = 150,
  687.     kQATagGL_TextureEnvColor_r    = 151,
  688.     kQATagGL_TextureEnvColor_g    = 152,
  689.     kQATagGL_TextureEnvColor_b    = 153
  690. };
  691. typedef enum TQATagFloat TQATagFloat;
  692.  
  693.  
  694. /* kQATag_ZFunction */
  695. enum {
  696.     kQAZFunction_None            = 0,                            /* Z is neither tested nor written (same as no Z buffer) */
  697.     kQAZFunction_LT                = 1,                            /* Znew < Zbuffer is visible */
  698.     kQAZFunction_EQ                = 2,                            /* Znew == Zbuffer is visible */
  699.     kQAZFunction_LE                = 3,                            /* Znew <= Zbuffer is visible */
  700.     kQAZFunction_GT                = 4,                            /* Znew > Zbuffer is visible */
  701.     kQAZFunction_NE                = 5,                            /* Znew != Zbuffer is visible */
  702.     kQAZFunction_GE                = 6,                            /* Znew >= Zbuffer is visible */
  703.     kQAZFunction_True            = 7,                            /* Znew is always visible */
  704.     kQAZFunction_False            = 8                                /* Znew is never visible */
  705. };
  706.  
  707. /* kQATag_Width */
  708. #define kQAMaxWidth 128.0
  709. /* kQATag_Antialias */
  710. enum {
  711.     kQAAntiAlias_Off            = 0,
  712.     kQAAntiAlias_Fast            = 1,
  713.     kQAAntiAlias_Mid            = 2,
  714.     kQAAntiAlias_Best            = 3
  715. };
  716.  
  717. /* kQATag_Blend */
  718. enum {
  719.     kQABlend_PreMultiply        = 0,
  720.     kQABlend_Interpolate        = 1,
  721.     kQABlend_OpenGL                = 2
  722. };
  723.  
  724. /* kQATag_BufferComposite */
  725. enum {
  726.     kQABufferComposite_None        = 0,                            /* Default: New pixels overwrite initial buffer contents */
  727.     kQABufferComposite_PreMultiply = 1,                            /* New pixels are blended with initial buffer contents via PreMultiply */
  728.     kQABufferComposite_Interpolate = 2                            /* New pixels are blended with initial buffer contents via Interpolate */
  729. };
  730.  
  731. /* kQATag_PerspectiveZ */
  732. enum {
  733.     kQAPerspectiveZ_Off            = 0,                            /* Use Z for hidden surface removal */
  734.     kQAPerspectiveZ_On            = 1                                /* Use InvW for hidden surface removal */
  735. };
  736.  
  737. /* kQATag_TextureFilter */
  738. enum {
  739.                                                                 /* suggested meanings of these values */
  740.     kQATextureFilter_Fast        = 0,                            /* No filtering, pick nearest */
  741.     kQATextureFilter_Mid        = 1,                            /* Fastest method that does some filtering */
  742.     kQATextureFilter_Best        = 2                                /* Highest quality renderer can do */
  743. };
  744.  
  745. /* filter tag values */
  746. enum {
  747.                                                                 /* suggested meanings of these values */
  748.     kQAFilter_Fast                = 0,                            /* No filtering, pick nearest */
  749.     kQAFilter_Mid                = 1,                            /* Fastest method that does some filtering */
  750.     kQAFilter_Best                = 2                                /* Highest quality renderer can do */
  751. };
  752.  
  753. /* kQATag_TextureOp (mask of one or more) */
  754. enum {
  755.     kQATextureOp_None            = 0,                            /* Default texture mapping mode */
  756.     kQATextureOp_Modulate        = (1 << 0),                        /* Modulate texture color with kd_r/g/b */
  757.     kQATextureOp_Highlight        = (1 << 1),                        /* Add highlight value ks_r/g/b */
  758.     kQATextureOp_Decal            = (1 << 2),                        /* When texture alpha == 0, use rgb instead */
  759.     kQATextureOp_Shrink            = (1 << 3),                        /* This is a non-wrapping texture, so the ??? */
  760.     kQATextureOp_Blend            = (1 << 4)                        /* Same as GL_TEXTURE_ENV_MODE GL_BLEND */
  761. };
  762.  
  763. /* kQATag_MultiTextureOp */
  764. enum {
  765.     kQAMultiTexture_Add            = 0,                            /* texels are added to form final pixel */
  766.     kQAMultiTexture_Modulate    = 1,                            /* texels are multiplied to form final pixel */
  767.     kQAMultiTexture_BlendAlpha    = 2,                            /* texels are blended according to 2nd texel's alpha */
  768.     kQAMultiTexture_Fixed        = 3                                /* texels are blended by a fixed factor via kQATag_MultiTextureFactor  */
  769. };
  770.  
  771. /* kQATag_CSGTag */
  772. #define kQACSGTag_None 0xffffffffUL
  773. enum {
  774.     kQACSGTag_0                    = 0,                            /* Submitted tris have CSG ID 0 */
  775.     kQACSGTag_1                    = 1,                            /* Submitted tris have CSG ID 1 */
  776.     kQACSGTag_2                    = 2,                            /* Submitted tris have CSG ID 2 */
  777.     kQACSGTag_3                    = 3,                            /* Submitted tris have CSG ID 3 */
  778.     kQACSGTag_4                    = 4                                /* Submitted tris have CSG ID 4 */
  779. };
  780.  
  781. /* kQATagGL_TextureWrapU/V */
  782. enum {
  783.     kQAGL_Repeat                = 0,
  784.     kQAGL_Clamp                    = 1
  785. };
  786.  
  787. /* kQATagGL_BlendSrc */
  788. enum {
  789.     kQAGL_SourceBlend_XXX        = 0
  790. };
  791.  
  792. /* kQATagGL_BlendDst */
  793. enum {
  794.     kQAGL_DestBlend_XXX            = 0
  795. };
  796.  
  797. /* kQATagGL_DrawBuffer (mask of one or more) */
  798. enum {
  799.     kQAGL_DrawBuffer_None        = 0,
  800.     kQAGL_DrawBuffer_FrontLeft    = (1 << 0),
  801.     kQAGL_DrawBuffer_FrontRight    = (1 << 1),
  802.     kQAGL_DrawBuffer_BackLeft    = (1 << 2),
  803.     kQAGL_DrawBuffer_BackRight    = (1 << 3),
  804.     kQAGL_DrawBuffer_Front        = (kQAGL_DrawBuffer_FrontLeft | kQAGL_DrawBuffer_FrontRight),
  805.     kQAGL_DrawBuffer_Back        = (kQAGL_DrawBuffer_BackLeft | kQAGL_DrawBuffer_BackRight)
  806. };
  807.  
  808. /* kQATag_FogMode */
  809. enum {
  810.     kQAFogMode_None                = 0,                            /* no fog                                    */
  811.     kQAFogMode_Alpha            = 1,                            /* fog value is alpha                        */
  812.     kQAFogMode_Linear            = 2,                            /* fog = (end - z) / (end - start)            */
  813.     kQAFogMode_Exponential        = 3,                            /* fog = exp(-density * z)                    */
  814.     kQAFogMode_ExponentialSquared = 4                            /* fog = exp(-density * z * density * z)    */
  815. };
  816.  
  817.  
  818. /* kQATag_ChannelMask */
  819. enum {
  820.     kQAChannelMask_r            = (1 << 0),
  821.     kQAChannelMask_g            = (1 << 1),
  822.     kQAChannelMask_b            = (1 << 2),
  823.     kQAChannelMask_a            = (1 << 3)
  824. };
  825.  
  826.  
  827. /* kQATag_ZBufferMask */
  828. enum {
  829.     kQAZBufferMask_Disable        = 0,
  830.     kQAZBufferMask_Enable        = 1
  831. };
  832.  
  833. /* kQATag_AlphaTestFunc */
  834. enum {
  835.     kQAAlphaTest_None            = 0,
  836.     kQAAlphaTest_LT                = 1,
  837.     kQAAlphaTest_EQ                = 2,
  838.     kQAAlphaTest_LE                = 3,
  839.     kQAAlphaTest_GT                = 4,
  840.     kQAAlphaTest_NE                = 5,
  841.     kQAAlphaTest_GE                = 6,
  842.     kQAAlphaTest_True            = 7
  843. };
  844.  
  845.  
  846. /* flags for QAAccess__xxx */
  847. enum {
  848.     kQANoCopyNeeded                = (1 << 0)
  849. };
  850.  
  851.  
  852. /************************************************************************************************
  853.  *
  854.  * Constants used as function parameters.
  855.  *
  856.  ***********************************************************************************************/
  857. /*
  858.  * TQAVertexMode is a parameter to QADrawVGouraud() and QADrawVTexture() that specifies how
  859.  * to interpret and draw the vertex array.
  860.  */
  861.  
  862. enum TQAVertexMode {
  863.     kQAVertexMode_Point            = 0,                            /* Draw nVertices points */
  864.     kQAVertexMode_Line            = 1,                            /* Draw nVertices/2 line segments */
  865.     kQAVertexMode_Polyline        = 2,                            /* Draw nVertices-1 connected line segments */
  866.     kQAVertexMode_Tri            = 3,                            /* Draw nVertices/3 triangles */
  867.     kQAVertexMode_Strip            = 4,                            /* Draw nVertices-2 triangles as a strip */
  868.     kQAVertexMode_Fan            = 5,                            /* Draw nVertices-2 triangles as a fan from v0 */
  869.     kQAVertexMode_NumModes        = 6
  870. };
  871. typedef enum TQAVertexMode TQAVertexMode;
  872.  
  873. /*
  874.  * TQAGestaltSelector is a parameter to QAEngineGestalt(). It selects which gestalt
  875.  * parameter will be copied into 'response'.
  876.  */
  877.  
  878. enum TQAGestaltSelector {
  879.     kQAGestalt_OptionalFeatures    = 0,                            /* Mask of one or more kQAOptional_xxx */
  880.     kQAGestalt_FastFeatures        = 1,                            /* Mask of one or more kQAFast_xxx */
  881.     kQAGestalt_VendorID            = 2,                            /* Vendor ID */
  882.     kQAGestalt_EngineID            = 3,                            /* Engine ID */
  883.     kQAGestalt_Revision            = 4,                            /* Revision number of this engine */
  884.     kQAGestalt_ASCIINameLength    = 5,                            /* strlen (asciiName) */
  885.     kQAGestalt_ASCIIName        = 6,                            /* Causes strcpy (response, asciiName) */
  886.     kQAGestalt_TextureMemory    = 7,                            /* amount of texture RAM currently available */
  887.     kQAGestalt_FastTextureMemory = 8,                            /* amount of texture RAM currently available */
  888.     kQAGestalt_DrawContextPixelTypesAllowed = 9,                /* returns all the draw context pixel types supported by the RAVE engine */
  889.     kQAGestalt_DrawContextPixelTypesPreferred = 10,                /* returns all the draw context pixel types that are preferred by the RAVE engine. */
  890.     kQAGestalt_TexturePixelTypesAllowed = 11,                    /* returns all the texture pixel types that are supported by the RAVE engine */
  891.     kQAGestalt_TexturePixelTypesPreferred = 12,                    /* returns all the texture pixel types that are preferred by the RAVE engine.*/
  892.     kQAGestalt_BitmapPixelTypesAllowed = 13,                    /* returns all the bitmap pixel types that are supported by the RAVE engine. */
  893.     kQAGestalt_BitmapPixelTypesPreferred = 14,                    /* returns all the bitmap pixel types that are preferred by the RAVE engine. */
  894.     kQAGestalt_OptionalFeatures2 = 15,                            /* Mask of one or more kQAOptional2_xxx */
  895.     kQAGestalt_MultiTextureMax    = 16,                            /* max number of multi textures supported by this engine */
  896.     kQAGestalt_NumSelectors        = 17,
  897.     kQAGestalt_EngineSpecific_Minimum = 1000                    /* all gestalts here and above are for engine specific purposes */
  898. };
  899. typedef enum TQAGestaltSelector TQAGestaltSelector;
  900.  
  901. /*
  902.  * TQAMethodSelector is a parameter to QASetNoticeMethod to select the notice method
  903.  */
  904. #if RAVE_OBSOLETE
  905.  
  906. enum TQAMethodSelector {
  907.     kQAMethod_RenderCompletion    = 0,                            /* Called when rendering has completed and buffers swapped */
  908.     kQAMethod_DisplayModeChanged = 1,                            /* Called when a display mode has changed */
  909.     kQAMethod_ReloadTextures    = 2,                            /* Called when texture memory has been invalidated */
  910.     kQAMethod_BufferInitialize    = 3,                            /* Called when a buffer needs to be initialized */
  911.     kQAMethod_BufferComposite    = 4,                            /* Called when rendering is finished and its safe to composite */
  912.     kQAMethod_NumSelectors        = 5
  913. };
  914. typedef enum TQAMethodSelector TQAMethodSelector;
  915.  
  916. #else
  917.  
  918. enum TQAMethodSelector {
  919.     kQAMethod_RenderCompletion    = 0,                            /* Called when rendering has completed and buffers swapped */
  920.     kQAMethod_DisplayModeChanged = 1,                            /* Called when a display mode has changed */
  921.     kQAMethod_ReloadTextures    = 2,                            /* Called when texture memory has been invalidated */
  922.     kQAMethod_ImageBufferInitialize = 3,                        /* Called when a buffer needs to be initialized */
  923.     kQAMethod_ImageBuffer2DComposite = 4,                        /* Called when rendering is finished and its safe to composite */
  924.     kQAMethod_NumSelectors        = 5
  925. };
  926. typedef enum TQAMethodSelector TQAMethodSelector;
  927.  
  928. #endif  /* RAVE_OBSOLETE */
  929.  
  930. /*
  931.  * kQATriFlags_xxx are ORed together to generate the 'flags' parameter
  932.  * to QADrawTriGouraud() and QADrawTriTexture().
  933.  */
  934. enum {
  935.     kQATriFlags_None            = 0,                            /* No flags (triangle is front-facing or don't care) */
  936.     kQATriFlags_Backfacing        = (1 << 0)                        /* Triangle is back-facing */
  937. };
  938.  
  939. /*
  940.  * kQATexture_xxx are ORed together to generate the 'flags' parameter to QATextureNew().
  941.  */
  942. enum {
  943.     kQATexture_None                = 0,                            /* No flags */
  944.     kQATexture_Lock                = (1 << 0),                        /* Don't swap this texture out */
  945.     kQATexture_Mipmap            = (1 << 1),                        /* This texture is mipmapped */
  946.     kQATexture_NoCompression    = (1 << 2),                        /* Do not compress this texture */
  947.     kQATexture_HighCompression    = (1 << 3),                        /* Compress texture, even if it takes a while */
  948.     kQATexture_NonRelocatable    = (1 << 4),                        /* Image buffer in VRAM should be non-relocatable */
  949.     kQATexture_NoCopy            = (1 << 5),                        /* Don't copy image to VRAM when creating it */
  950.     kQATexture_FlipOrigin        = (1 << 6),                        /* The image(s) is(are) in a bottom-up format. (The image(s) is(are) flipped vertically.) */
  951.     kQATexture_PriorityBits        = (1 << 31) | (1 << 30) | (1 << 29) | (1 << 28) /* Texture priority: 4 upper bits for 16 levels of priority */
  952. };
  953.  
  954. /*
  955.  * kQABitmap_xxx are ORed together to generate the 'flags' parameter to QABitmapNew().
  956.  */
  957. enum {
  958.     kQABitmap_None                = 0,                            /* No flags */
  959.     kQABitmap_Lock                = (1 << 1),                        /* Don't swap this bitmap out */
  960.     kQABitmap_NoCompression        = (1 << 2),                        /* Do not compress this bitmap */
  961.     kQABitmap_HighCompression    = (1 << 3),                        /* Compress bitmap, even if it takes a while */
  962.     kQABitmap_NonRelocatable    = (1 << 4),                        /* Image buffer in VRAM should be non-relocatable */
  963.     kQABitmap_NoCopy            = (1 << 5),                        /* Don't copy image to VRAM when creating it */
  964.     kQABitmap_FlipOrigin        = (1 << 6),                        /* The image is in a bottom-up format. (The image is flipped vertically.) */
  965.     kQABitmap_PriorityBits        = (1 << 31) | (1 << 30) | (1 << 29) | (1 << 28) /* Bitmap priority: 4 upper bits for 16 levels of priority */
  966. };
  967.  
  968. /*
  969.  * kQAContext_xxx are ORed together to generate the 'flags' parameter for QADrawContextNew().
  970.  */
  971. enum {
  972.     kQAContext_None                = 0,                            /* No flags */
  973.     kQAContext_NoZBuffer        = (1 << 0),                        /* No hidden surface removal */
  974.     kQAContext_DeepZ            = (1 << 1),                        /* Hidden surface precision >= 24 bits */
  975.     kQAContext_DoubleBuffer        = (1 << 2),                        /* Double buffered window */
  976.     kQAContext_Cache            = (1 << 3),                        /* This is a cache context */
  977.     kQAContext_NoDither            = (1 << 4),                        /* No dithering, straight color banding */
  978.     kQAContext_Scale            = (1 << 5),                        /* The draw context is to be scaled.  The front buffer is a different size than the back buffer. */
  979.     kQAContext_NonRelocatable    = (1 << 6),                        /* The back buffer and the z buffer must not move in memory */
  980.     kQAContext_EngineSpecific1    = (1 << 28),                    /* engine specific flag # 1 */
  981.     kQAContext_EngineSpecific2    = (1 << 29),                    /* engine specific flag # 2 */
  982.     kQAContext_EngineSpecific3    = (1 << 30),                    /* engine specific flag # 3 */
  983.     kQAContext_EngineSpecific4    = (1 << 31)                        /* engine specific flag # 4 */
  984. };
  985.  
  986. /*
  987.  * kQAOptional_xxx are ORed together to generate the kQAGestalt_OptionalFeatures response
  988.  * from QAEngineGestalt().
  989.  */
  990. enum {
  991.     kQAOptional_None            = 0,                            /* No optional features */
  992.     kQAOptional_DeepZ            = (1 << 0),                        /* Hidden surface precision >= 24 bits */
  993.     kQAOptional_Texture            = (1 << 1),                        /* Texture mapping */
  994.     kQAOptional_TextureHQ        = (1 << 2),                        /* High quality texture (tri-linear mip or better) */
  995.     kQAOptional_TextureColor    = (1 << 3),                        /* Full color modulation and highlight of textures */
  996.     kQAOptional_Blend            = (1 << 4),                        /* Transparency blending of RGB */
  997.     kQAOptional_BlendAlpha        = (1 << 5),                        /* Transparency blending includes alpha channel */
  998.     kQAOptional_Antialias        = (1 << 6),                        /* Antialiased rendering */
  999.     kQAOptional_ZSorted            = (1 << 7),                        /* Z sorted rendering (for transparency, etc.) */
  1000.     kQAOptional_PerspectiveZ    = (1 << 8),                        /* Hidden surface removal using InvW instead of Z */
  1001.     kQAOptional_OpenGL            = (1 << 9),                        /* Extended rasterization features for OpenGL(tm) */
  1002.     kQAOptional_NoClear            = (1 << 10),                    /* This drawing engine doesn't clear before drawing */
  1003.     kQAOptional_CSG                = (1 << 11),                    /* kQATag_CSGxxx are implemented */
  1004.     kQAOptional_BoundToDevice    = (1 << 12),                    /* This engine is tightly bound to GDevice */
  1005.     kQAOptional_CL4                = (1 << 13),                    /* This engine suports kQAPixel_CL4 */
  1006.     kQAOptional_CL8                = (1 << 14),                    /* This engine suports kQAPixel_CL8 */
  1007.     kQAOptional_BufferComposite    = (1 << 15),                    /* This engine can composite with initial buffer contents */
  1008.     kQAOptional_NoDither        = (1 << 16),                    /* This engine can draw with no dithering */
  1009.     kQAOptional_FogAlpha        = (1 << 17),                    /* This engine suports alpha based fog */
  1010.     kQAOptional_FogDepth        = (1 << 18),                    /* This engine suports depth based fog */
  1011.     kQAOptional_MultiTextures    = (1 << 19),                    /* This bit set if engine supports texture compositing */
  1012.     kQAOptional_MipmapBias        = (1 << 20),                    /* This bit is set if the engine supports mipmap selection bias */
  1013.     kQAOptional_ChannelMask        = (1 << 21),
  1014.     kQAOptional_ZBufferMask        = (1 << 22),
  1015.     kQAOptional_AlphaTest        = (1 << 23),                    /* this engine supports alpha testing */
  1016.     kQAOptional_AccessTexture    = (1 << 24),                    /* if engine supports access to texture */
  1017.     kQAOptional_AccessBitmap    = (1 << 25),                    /* if engine supports access to bitmaps */
  1018.     kQAOptional_AccessDrawBuffer = (1 << 26),                    /* if engine supports access to draw buffer */
  1019.     kQAOptional_AccessZBuffer    = (1 << 27),                    /* if engine supports access to zbuffer */
  1020.     kQAOptional_ClearDrawBuffer    = (1 << 28),                    /* if engine supports QAClearDrawBuffer() */
  1021.     kQAOptional_ClearZBuffer    = (1 << 29),                    /* if engine supports QAClearZBuffer() */
  1022.     kQAOptional_OffscreenDrawContexts = (1 << 30)                /* if engine supports TQADeviceOffscreen */
  1023. };
  1024.  
  1025. /*
  1026.  * kQAOptional2_xxx are ORed together to generate the kQAGestalt_OptionalFeatures2 response
  1027.  * from QAEngineGestalt().
  1028.  */
  1029. enum {
  1030.     kQAOptional2_None            = 0,
  1031.     kQAOptional2_TextureDrawContexts = (1 << 1),                /* if engine supports QATextureNewFromDrawContext() */
  1032.     kQAOptional2_BitmapDrawContexts = (1 << 2),                    /* if engine supports QABitmapNewFromDrawContext() */
  1033.     kQAOptional2_Busy            = (1 << 3),                        /* if engine supports QABusy() */
  1034.     kQAOptional2_SwapBuffers    = (1 << 4),                        /* if engine supports QASwapBuffers() */
  1035.     kQAOptional2_Chromakey        = (1 << 5),                        /* if engine supports chromakeying via kQATag_Chromakey_xxx */
  1036.     kQAOptional2_NonRelocatable    = (1 << 6),                        /* if engine supports nonrelocatable texture & bitmap image buffers in VRAM */
  1037.     kQAOptional2_NoCopy            = (1 << 7),                        /* if engine supports ability to not copy texture & bitmap image to VRAM */
  1038.     kQAOptional2_PriorityBits    = (1 << 8),                        /* if engine supports texture & bitmap priority levels */
  1039.     kQAOptional2_FlipOrigin        = (1 << 9),                        /* if engine supports textures & bitmaps that are vertically flipped */
  1040.     kQAOptional2_BitmapScale    = (1 << 10),                    /* if engine supports scaled bitmap drawing */
  1041.     kQAOptional2_DrawContextScale = (1 << 11),                    /* if engine supports scaled draw contexts */
  1042.     kQAOptional2_DrawContextNonRelocatable = (1 << 12)            /* if engine supports draw contexts with non relocatable buffers */
  1043. };
  1044.  
  1045.  
  1046. /*
  1047.  * kQAFast_xxx are ORed together to generate the kQAGestalt_FastFeatures response
  1048.  * from QAEngineGestalt().
  1049.  */
  1050. enum {
  1051.     kQAFast_None                = 0,                            /* No accelerated features */
  1052.     kQAFast_Line                = (1 << 0),                        /* Line drawing */
  1053.     kQAFast_Gouraud                = (1 << 1),                        /* Gouraud shaded triangles */
  1054.     kQAFast_Texture                = (1 << 2),                        /* Texture mapped triangles */
  1055.     kQAFast_TextureHQ            = (1 << 3),                        /* High quality texture (tri-linear mip or better) */
  1056.     kQAFast_Blend                = (1 << 4),                        /* Transparency blending */
  1057.     kQAFast_Antialiasing        = (1 << 5),                        /* Antialiased rendering */
  1058.     kQAFast_ZSorted                = (1 << 6),                        /* Z sorted rendering of non-opaque objects */
  1059.     kQAFast_CL4                    = (1 << 7),                        /* This engine accelerates kQAPixel_CL4 */
  1060.     kQAFast_CL8                    = (1 << 8),                        /* This engine accelerates kQAPixel_CL8 */
  1061.     kQAFast_FogAlpha            = (1 << 9),                        /* This engine accelerates alpha based fog */
  1062.     kQAFast_FogDepth            = (1 << 10),                    /* This engine accelerates depth based fog */
  1063.     kQAFast_MultiTextures        = (1 << 11),                    /* This engine accelerates texture compositing */
  1064.     kQAFast_BitmapScale            = (1 << 12),                    /* This engine accelerates scaled bitmap drawing */
  1065.     kQAFast_DrawContextScale    = (1 << 13)                        /* This engine accelerates scaled draw contexts */
  1066. };
  1067.  
  1068.  
  1069.  
  1070. /************************************************************************************************
  1071.  *
  1072.  * Macro definition for easily setting the texture priority bits in the flags field of
  1073.  * QATextureNew(), and QABitMapNew().
  1074.  *
  1075.  * The priority value must be a number between 0 and 15.  0 is top priority, and 15 is lowest
  1076.  * priority. Note that this is different than OpenGL which uses floats from 0.0 to 1.0 where
  1077.  * 1.0 is top priority. In RAVE, this system is more like texture ranking, thus 0 is top rank,
  1078.  * and 15 is the last ranking.
  1079.  *
  1080.  * Texture prioritization is mainly used for systems which support AGP memory.  This allows the
  1081.  * hardware driver to determine which textures to put into faster VRAM and which to put into
  1082.  * slower AGP RAM. If you dont care about texture priority, then you dont need to worry about
  1083.  * this macro or the priority bits since the default will always be top priority when all 4 bits
  1084.  * of this flag field are 0's.
  1085.  *
  1086.  * To upload a texture with high priority, do the following:
  1087.  *
  1088.  *         unsigned long flags = kQATexture_Mipmap;            // Initialize flags
  1089.  *
  1090.  *        flags |= QACalculatePriorityBits(0);                // Setting top priority (this actually does
  1091.  *                                                            // nothing since the bits are still 0000)
  1092.  *         QATextureNew(myEngine, flags, pixelType, image, &raveTexture);
  1093.  *
  1094.  *
  1095.  * To do a texture with a middle priority of 8, do the following:
  1096.  *
  1097.  *         unsigned long flags = kQATexture_HighCompression;    // Initialize flags
  1098.  *
  1099.  *        flags |= QACalculatePriorityBits(8);                // Setting middle priority
  1100.  *
  1101.  *         QATextureNew(myEngine, flags, pixelType, image, &raveTexture);
  1102.  *
  1103.  ***********************************************************************************************/
  1104.  
  1105. #define QACalculatePriorityBits(_priority)  (((unsigned long) (_priority)) << 28)
  1106.  
  1107.  
  1108.  
  1109. /************************************************************************************************
  1110.  *
  1111.  * Macro definitions for the drawing engine methods included in TQADrawContext. These
  1112.  * macros are the recommended means of accessing the engine's draw methods, e.g:
  1113.  *
  1114.  *        TQADrawContext    *drawContext;
  1115.  *        TQAVTexture        vertices[3];
  1116.  *
  1117.  *        drawContext = QADrawContextNew (rect, gdevice, engine, kQAContext_ZBuffer);
  1118.  *        ...
  1119.  *        QASetInt (drawContext, kQATag_ZFunction, kQAZFunction_LT);
  1120.  *        QADrawTriGouraud (drawContext, &vertices[0], &vertices[1], &vertices[2], kQATriFlags_None);
  1121.  *
  1122.  * Note that QARenderStart(), QARenderEnd(), QAFlush() and QASync() have real function
  1123.  * definitions instead of macros. This is because these functions can afford the extra
  1124.  * per-call overhead of a function layer (which makes application code a little smaller),
  1125.  * and to allow a cleaner implementation of handling NULL parameters to QARenderStart().
  1126.  *
  1127.  ***********************************************************************************************/
  1128.  
  1129.  
  1130. #define QASetFloat(drawContext,tag,newValue) \
  1131.         (drawContext)->setFloat (drawContext,tag,newValue)
  1132.  
  1133. #define QASetInt(drawContext,tag,newValue) \
  1134.         (drawContext)->setInt (drawContext,tag,newValue)
  1135.  
  1136. #define QASetPtr(drawContext,tag,newValue) \
  1137.         (drawContext)->setPtr (drawContext,tag,newValue)
  1138.  
  1139. #define QAGetFloat(drawContext,tag) \
  1140.         (drawContext)->getFloat (drawContext,tag)
  1141.  
  1142. #define QAGetInt(drawContext,tag) \
  1143.         (drawContext)->getInt (drawContext,tag)
  1144.  
  1145. #define QAGetPtr(drawContext,tag) \
  1146.         (drawContext)->getPtr (drawContext,tag)
  1147.  
  1148. #define QADrawPoint(drawContext,v) \
  1149.         (drawContext)->drawPoint (drawContext,v)
  1150.  
  1151. #define QADrawLine(drawContext,v0,v1) \
  1152.         (drawContext)->drawLine (drawContext,v0,v1)
  1153.  
  1154. #define QADrawTriGouraud(drawContext,v0,v1,v2,flags) \
  1155.         (drawContext)->drawTriGouraud (drawContext,v0,v1,v2,flags)
  1156.  
  1157. #define QADrawTriTexture(drawContext,v0,v1,v2,flags) \
  1158.         (drawContext)->drawTriTexture (drawContext,v0,v1,v2,flags)
  1159.  
  1160. #define QASubmitVerticesGouraud(drawContext,nVertices,vertices) \
  1161.         (drawContext)->submitVerticesGouraud(drawContext,nVertices,vertices)
  1162.         
  1163. #define QASubmitVerticesTexture(drawContext,nVertices,vertices) \
  1164.         (drawContext)->submitVerticesTexture(drawContext,nVertices,vertices)
  1165.         
  1166. #define QASubmitMultiTextureParams(drawContext,nParams,params) \
  1167.         (drawContext)->submitMultiTextureParams(drawContext,nParams,params)
  1168.  
  1169.  
  1170.         
  1171. #define QADrawTriMeshGouraud(drawContext,nTriangle,triangles) \
  1172.         (drawContext)->drawTriMeshGouraud (drawContext,nTriangle,triangles)
  1173.  
  1174. #define QADrawTriMeshTexture(drawContext,nTriangle,triangles) \
  1175.         (drawContext)->drawTriMeshTexture (drawContext,nTriangle,triangles)
  1176.  
  1177. #define QADrawVGouraud(drawContext,nVertices,vertexMode,vertices,flags) \
  1178.         (drawContext)->drawVGouraud (drawContext,nVertices,vertexMode,vertices,flags)
  1179.  
  1180. #define QADrawVTexture(drawContext,nVertices,vertexMode,vertices,flags) \
  1181.         (drawContext)->drawVTexture (drawContext,nVertices,vertexMode,vertices,flags)
  1182.  
  1183. #define QADrawBitmap(drawContext,v,bitmap) \
  1184.         (drawContext)->drawBitmap (drawContext,v,bitmap)
  1185.  
  1186. #define QARenderStart(drawContext,dirtyRect,initialContext) \
  1187.         (drawContext)->renderStart (drawContext,dirtyRect,initialContext)
  1188.  
  1189. #define QARenderEnd(drawContext,modifiedRect) \
  1190.         (drawContext)->renderEnd (drawContext,modifiedRect)
  1191.  
  1192. #define QARenderAbort(drawContext) \
  1193.         (drawContext)->renderAbort (drawContext)
  1194.  
  1195. #define QAFlush(drawContext) \
  1196.         (drawContext)->flush (drawContext)
  1197.  
  1198. #define QASync(drawContext) \
  1199.         (drawContext)->sync (drawContext)
  1200.  
  1201. #define QASetNoticeMethod(drawContext, method, completionCallBack, refCon) \
  1202.         (drawContext)->setNoticeMethod (drawContext, method, completionCallBack, refCon)
  1203.  
  1204. #define QAGetNoticeMethod(drawContext, method, completionCallBack, refCon) \
  1205.         (drawContext)->getNoticeMethod (drawContext, method, completionCallBack, refCon)
  1206.         
  1207. #define QAAccessDrawBuffer(drawContext, pixelBuffer) \
  1208.         (drawContext)->accessDrawBuffer(drawContext, pixelBuffer)
  1209.  
  1210. #define QAAccessDrawBufferEnd(drawContext, dirtyRect) \
  1211.         (drawContext)->accessDrawBufferEnd(drawContext, dirtyRect)
  1212.  
  1213. #define QAAccessZBuffer(drawContext, zBuffer) \
  1214.         (drawContext)->accessZBuffer(drawContext, zBuffer)
  1215.  
  1216. #define QAAccessZBufferEnd(drawContext, dirtyRect) \
  1217.         (drawContext)->accessZBufferEnd(drawContext, dirtyRect)
  1218.  
  1219.  
  1220.         
  1221. #define QAClearDrawBuffer(drawContext, rect, initialContext) \
  1222.         (drawContext)->clearDrawBuffer(drawContext, rect, initialContext)
  1223.  
  1224. #define QAClearZBuffer(drawContext, rect, initialContext) \
  1225.         (drawContext)->clearZBuffer(drawContext, rect, initialContext)
  1226.  
  1227. #define QATextureNewFromDrawContext(drawContext, flags, newTexture) \
  1228.         (drawContext)->textureFromContext(drawContext, flags, newTexture)
  1229.  
  1230. #define QABitmapNewFromDrawContext(drawContext, flags, newBitmap) \
  1231.         (drawContext)->bitmapFromContext(drawContext, flags, newBitmap)
  1232.  
  1233. #define QABusy(drawContext) \
  1234.         (drawContext)->busy(drawContext)
  1235.  
  1236. #define QASwapBuffers(drawContext, dirtyRect) \
  1237.         (drawContext)->swapBuffers(drawContext, dirtyRect)
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243. /********************************************************************
  1244.  * TQAVersion sets the TQADrawContext 'version' field. It is set by
  1245.  * the manager to indicate the version of the TQADrawContext structure.
  1246.  *******************************************************************/
  1247.  
  1248. enum TQAVersion {
  1249.     kQAVersion_Prerelease        = 0,
  1250.     kQAVersion_1_0                = 1,
  1251.     kQAVersion_1_0_5            = 2,                            /* Added tri mesh functions, color tables */
  1252.     kQAVersion_1_5                = 3,                            /* Added call backs, texture compression, and new error return code */
  1253.     kQAVersion_1_6                = 4                                /* Added QAAccess_xxx, fog, _Options2, Clear_xxx, etc. */
  1254. };
  1255. typedef enum TQAVersion TQAVersion;
  1256.  
  1257.  
  1258.  
  1259. /***********************************************************************
  1260.  * TQADrawContext structure holds method pointers.
  1261.  * This is a forward refrence. The structure is defined later.
  1262.  **********************************************************************/
  1263. typedef struct TQADrawContext             TQADrawContext;
  1264. /************************************************************************************************
  1265.  *
  1266.  * Typedefs of draw method functions provided by the drawing engine. One function pointer
  1267.  * for each of these function types in stored in the TQADrawContext public data structure.
  1268.  *
  1269.  * These functions should be accessed through the QA<function>(context,...) macros,
  1270.  * defined above.
  1271.  *
  1272.  ***********************************************************************************************/
  1273. typedef CALLBACK_API_C( void , TQAStandardNoticeMethod )(const TQADrawContext *drawContext, void *refCon);
  1274. typedef CALLBACK_API_C( void , TQABufferNoticeMethod )(const TQADrawContext *drawContext, const TQADevice *buffer, const TQARect *dirtyRect, void *refCon);
  1275.  
  1276. union TQANoticeMethod {
  1277.     TQAStandardNoticeMethod         standardNoticeMethod;        /* Used for non-buffer related methods */
  1278.     TQABufferNoticeMethod             bufferNoticeMethod;            /* Used for buffer handling methods */
  1279. };
  1280. typedef union TQANoticeMethod            TQANoticeMethod;
  1281. typedef CALLBACK_API_C( void , TQASetFloat )(TQADrawContext *drawContext, TQATagFloat tag, float newValue);
  1282. typedef CALLBACK_API_C( void , TQASetInt )(TQADrawContext *drawContext, TQATagInt tag, unsigned long newValue);
  1283. typedef CALLBACK_API_C( void , TQASetPtr )(TQADrawContext *drawContext, TQATagPtr tag, const void *newValue);
  1284. typedef CALLBACK_API_C( float , TQAGetFloat )(const TQADrawContext *drawContext, TQATagFloat tag);
  1285. typedef CALLBACK_API_C( unsigned long , TQAGetInt )(const TQADrawContext *drawContext, TQATagInt tag);
  1286. typedef CALLBACK_API_C( void *, TQAGetPtr )(const TQADrawContext *drawContext, TQATagPtr tag);
  1287. typedef CALLBACK_API_C( void , TQADrawPoint )(const TQADrawContext *drawContext, const TQAVGouraud *v);
  1288. typedef CALLBACK_API_C( void , TQADrawLine )(const TQADrawContext *drawContext, const TQAVGouraud *v0, const TQAVGouraud *v1);
  1289. typedef CALLBACK_API_C( void , TQADrawTriGouraud )(const TQADrawContext *drawContext, const TQAVGouraud *v0, const TQAVGouraud *v1, const TQAVGouraud *v2, unsigned long flags);
  1290. typedef CALLBACK_API_C( void , TQADrawTriTexture )(const TQADrawContext *drawContext, const TQAVTexture *v0, const TQAVTexture *v1, const TQAVTexture *v2, unsigned long flags);
  1291. typedef CALLBACK_API_C( void , TQASubmitVerticesGouraud )(const TQADrawContext *drawContext, unsigned long nVertices, const TQAVGouraud *vertices);
  1292. typedef CALLBACK_API_C( void , TQASubmitVerticesTexture )(const TQADrawContext *drawContext, unsigned long nVertices, const TQAVTexture *vertices);
  1293. typedef CALLBACK_API_C( void , TQADrawTriMeshGouraud )(const TQADrawContext *drawContext, unsigned long nTriangles, const TQAIndexedTriangle *triangles);
  1294. typedef CALLBACK_API_C( void , TQADrawTriMeshTexture )(const TQADrawContext *drawContext, unsigned long nTriangles, const TQAIndexedTriangle *triangles);
  1295. typedef CALLBACK_API_C( void , TQADrawVGouraud )(const TQADrawContext *drawContext, unsigned long nVertices, TQAVertexMode vertexMode, const TQAVGouraud vertices[], const unsigned long flags[]);
  1296. typedef CALLBACK_API_C( void , TQADrawVTexture )(const TQADrawContext *drawContext, unsigned long nVertices, TQAVertexMode vertexMode, const TQAVTexture vertices[], const unsigned long flags[]);
  1297. typedef CALLBACK_API_C( void , TQADrawBitmap )(const TQADrawContext *drawContext, const TQAVGouraud *v, TQABitmap *bitmap);
  1298. typedef CALLBACK_API_C( void , TQARenderStart )(const TQADrawContext *drawContext, const TQARect *dirtyRect, const TQADrawContext *initialContext);
  1299. typedef CALLBACK_API_C( TQAError , TQARenderEnd )(const TQADrawContext *drawContext, const TQARect *modifiedRect);
  1300. typedef CALLBACK_API_C( TQAError , TQARenderAbort )(const TQADrawContext *drawContext);
  1301. typedef CALLBACK_API_C( TQAError , TQAFlush )(const TQADrawContext *drawContext);
  1302. typedef CALLBACK_API_C( TQAError , TQASync )(const TQADrawContext *drawContext);
  1303. typedef CALLBACK_API_C( TQAError , TQASetNoticeMethod )(const TQADrawContext *drawContext, TQAMethodSelector method, TQANoticeMethod completionCallBack, void *refCon);
  1304. typedef CALLBACK_API_C( TQAError , TQAGetNoticeMethod )(const TQADrawContext *drawContext, TQAMethodSelector method, TQANoticeMethod *completionCallBack, void **refCon);
  1305. typedef CALLBACK_API_C( void , TQASubmitMultiTextureParams )(const TQADrawContext *drawContext, unsigned long nParams, const TQAVMultiTexture *params);
  1306. typedef CALLBACK_API_C( TQAError , TQAAccessDrawBuffer )(const TQADrawContext *drawContext, TQAPixelBuffer *buffer);
  1307. typedef CALLBACK_API_C( TQAError , TQAAccessDrawBufferEnd )(const TQADrawContext *drawContext, const TQARect *dirtyRect);
  1308. typedef CALLBACK_API_C( TQAError , TQAAccessZBuffer )(const TQADrawContext *drawContext, TQAZBuffer *buffer);
  1309. typedef CALLBACK_API_C( TQAError , TQAAccessZBufferEnd )(const TQADrawContext *drawContext, const TQARect *dirtyRect);
  1310. typedef CALLBACK_API_C( TQAError , TQAClearDrawBuffer )(const TQADrawContext *drawContext, const TQARect *rect, const TQADrawContext *initialContext);
  1311. typedef CALLBACK_API_C( TQAError , TQAClearZBuffer )(const TQADrawContext *drawContext, const TQARect *rect, const TQADrawContext *initialContext);
  1312. typedef CALLBACK_API_C( TQAError , TQATextureNewFromDrawContext )(const TQADrawContext *drawContext, unsigned long flags, TQATexture **newTexture);
  1313. typedef CALLBACK_API_C( TQAError , TQABitmapNewFromDrawContext )(const TQADrawContext *drawContext, unsigned long flags, TQABitmap **newBitmap);
  1314. typedef CALLBACK_API_C( TQABoolean , TQABusy )(const TQADrawContext *drawContext);
  1315. typedef CALLBACK_API_C( TQAError , TQASwapBuffers )(const TQADrawContext *drawContext, const TQARect *dirtyRect);
  1316. /************************************************************************************************
  1317.  *
  1318.  * Public TQADrawContext structure. This contains function pointers for the chosen
  1319.  * drawing engine.
  1320.  *
  1321.  ***********************************************************************************************/
  1322.  
  1323. struct TQADrawContext {
  1324.     TQADrawPrivate *                drawPrivate;                /* Engine's private data for this context */
  1325.     TQAVersion                         version;                    /* Version number */
  1326.     TQASetFloat                     setFloat;                    /* Method: Set a float state variable */
  1327.     TQASetInt                         setInt;                        /* Method: Set an unsigned long state variable */
  1328.     TQASetPtr                         setPtr;                        /* Method: Set an unsigned long state variable */
  1329.     TQAGetFloat                     getFloat;                    /* Method: Get a float state variable */
  1330.     TQAGetInt                         getInt;                        /* Method: Get an unsigned long state variable */
  1331.     TQAGetPtr                         getPtr;                        /* Method: Get an pointer state variable */
  1332.     TQADrawPoint                     drawPoint;                    /* Method: Draw a point */
  1333.     TQADrawLine                     drawLine;                    /* Method: Draw a line */
  1334.     TQADrawTriGouraud                 drawTriGouraud;                /* Method: Draw a Gouraud shaded triangle */
  1335.     TQADrawTriTexture                 drawTriTexture;                /* Method: Draw a texture mapped triangle */
  1336.     TQADrawVGouraud                 drawVGouraud;                /* Method: Draw Gouraud vertices */
  1337.     TQADrawVTexture                 drawVTexture;                /* Method: Draw texture vertices */
  1338.     TQADrawBitmap                     drawBitmap;                    /* Method: Draw a bitmap */
  1339.     TQARenderStart                     renderStart;                /* Method: Initialize for rendering */
  1340.     TQARenderEnd                     renderEnd;                    /* Method: Complete rendering and display */
  1341.     TQARenderAbort                     renderAbort;                /* Method: Abort any outstanding rendering (blocking) */
  1342.     TQAFlush                         flush;                        /* Method: Start render of any queued commands (non-blocking) */
  1343.     TQASync                         sync;                        /* Method: Wait for completion of all rendering (blocking) */
  1344.     TQASubmitVerticesGouraud         submitVerticesGouraud;        /* Method: Submit Gouraud vertices for trimesh */
  1345.     TQASubmitVerticesTexture         submitVerticesTexture;        /* Method: Submit Texture vertices for trimesh */
  1346.     TQADrawTriMeshGouraud             drawTriMeshGouraud;            /* Method: Draw a Gouraud triangle mesh */
  1347.     TQADrawTriMeshTexture             drawTriMeshTexture;            /* Method: Draw a Texture triangle mesh */
  1348.     TQASetNoticeMethod                 setNoticeMethod;            /* Method: Set a notice method */
  1349.     TQAGetNoticeMethod                 getNoticeMethod;            /* Method: Get a notice method */
  1350.     TQASubmitMultiTextureParams     submitMultiTextureParams;    /* Method: Submit Secondary texture params */
  1351.     TQAAccessDrawBuffer             accessDrawBuffer;
  1352.     TQAAccessDrawBufferEnd             accessDrawBufferEnd;
  1353.     TQAAccessZBuffer                 accessZBuffer;
  1354.     TQAAccessZBufferEnd             accessZBufferEnd;
  1355.     TQAClearDrawBuffer                 clearDrawBuffer;
  1356.     TQAClearZBuffer                 clearZBuffer;
  1357.     TQATextureNewFromDrawContext     textureFromContext;
  1358.     TQABitmapNewFromDrawContext     bitmapFromContext;
  1359.     TQABusy                         busy;
  1360.     TQASwapBuffers                     swapBuffers;
  1361. };
  1362.  
  1363. /************************************************************************************************
  1364.  *
  1365.  * Acceleration manager function prototypes.
  1366.  *
  1367.  ***********************************************************************************************/
  1368. EXTERN_API_C( TQAError )
  1369. QADrawContextNew                (const TQADevice *        device,
  1370.                                  const TQARect *        rect,
  1371.                                  const TQAClip *        clip,
  1372.                                  const TQAEngine *        engine,
  1373.                                  unsigned long             flags,
  1374.                                  TQADrawContext **        newDrawContext);
  1375.  
  1376. EXTERN_API_C( void )
  1377. QADrawContextDelete                (TQADrawContext *        drawContext);
  1378.  
  1379. EXTERN_API_C( TQAError )
  1380. QAColorTableNew                    (const TQAEngine *        engine,
  1381.                                  TQAColorTableType         tableType,
  1382.                                  void *                    pixelData,
  1383.                                  long                     transparentIndexFlag,
  1384.                                  TQAColorTable **        newTable);
  1385.  
  1386. EXTERN_API_C( void )
  1387. QAColorTableDelete                (const TQAEngine *        engine,
  1388.                                  TQAColorTable *        colorTable);
  1389.  
  1390. EXTERN_API_C( TQAError )
  1391. QATextureNew                    (const TQAEngine *        engine,
  1392.                                  unsigned long             flags,
  1393.                                  TQAImagePixelType         pixelType,
  1394.                                  const TQAImage         images[],
  1395.                                  TQATexture **            newTexture);
  1396.  
  1397. EXTERN_API_C( TQAError )
  1398. QATextureDetach                    (const TQAEngine *        engine,
  1399.                                  TQATexture *            texture);
  1400.  
  1401. EXTERN_API_C( void )
  1402. QATextureDelete                    (const TQAEngine *        engine,
  1403.                                  TQATexture *            texture);
  1404.  
  1405. EXTERN_API_C( TQAError )
  1406. QATextureBindColorTable            (const TQAEngine *        engine,
  1407.                                  TQATexture *            texture,
  1408.                                  TQAColorTable *        colorTable);
  1409.  
  1410. EXTERN_API_C( TQAError )
  1411. QABitmapNew                        (const TQAEngine *        engine,
  1412.                                  unsigned long             flags,
  1413.                                  TQAImagePixelType         pixelType,
  1414.                                  const TQAImage *        image,
  1415.                                  TQABitmap **            newBitmap);
  1416.  
  1417. EXTERN_API_C( TQAError )
  1418. QABitmapDetach                    (const TQAEngine *        engine,
  1419.                                  TQABitmap *            bitmap);
  1420.  
  1421. EXTERN_API_C( void )
  1422. QABitmapDelete                    (const TQAEngine *        engine,
  1423.                                  TQABitmap *            bitmap);
  1424.  
  1425. EXTERN_API_C( TQAError )
  1426. QABitmapBindColorTable            (const TQAEngine *        engine,
  1427.                                  TQABitmap *            bitmap,
  1428.                                  TQAColorTable *        colorTable);
  1429.  
  1430. EXTERN_API_C( TQAEngine *)
  1431. QADeviceGetFirstEngine            (const TQADevice *        device);
  1432.  
  1433. EXTERN_API_C( TQAEngine *)
  1434. QADeviceGetNextEngine            (const TQADevice *        device,
  1435.                                  const TQAEngine *        currentEngine);
  1436.  
  1437. EXTERN_API_C( TQAError )
  1438. QAEngineCheckDevice                (const TQAEngine *        engine,
  1439.                                  const TQADevice *        device);
  1440.  
  1441. EXTERN_API_C( TQAError )
  1442. QAEngineGestalt                    (const TQAEngine *        engine,
  1443.                                  TQAGestaltSelector     selector,
  1444.                                  void *                    response);
  1445.  
  1446. EXTERN_API_C( TQAError )
  1447. QAEngineEnable                    (long                     vendorID,
  1448.                                  long                     engineID);
  1449.  
  1450. EXTERN_API_C( TQAError )
  1451. QAEngineDisable                    (long                     vendorID,
  1452.                                  long                     engineID);
  1453.  
  1454.  
  1455. EXTERN_API_C( TQAError )
  1456. QAAccessTexture                    (const TQAEngine *        engine,
  1457.                                  TQATexture *            texture,
  1458.                                  long                     mipmapLevel,
  1459.                                  long                     flags,
  1460.                                  TQAPixelBuffer *        buffer);
  1461.  
  1462. EXTERN_API_C( TQAError )
  1463. QAAccessTextureEnd                (const TQAEngine *        engine,
  1464.                                  TQATexture *            texture,
  1465.                                  const TQARect *        dirtyRect);
  1466.  
  1467. EXTERN_API_C( TQAError )
  1468. QAAccessBitmap                    (const TQAEngine *        engine,
  1469.                                  TQABitmap *            bitmap,
  1470.                                  long                     flags,
  1471.                                  TQAPixelBuffer *        buffer);
  1472.  
  1473. EXTERN_API_C( TQAError )
  1474. QAAccessBitmapEnd                (const TQAEngine *        engine,
  1475.                                  TQABitmap *            bitmap,
  1476.                                  const TQARect *        dirtyRect);
  1477.  
  1478.  
  1479.  
  1480.  
  1481. #if TARGET_OS_MAC
  1482. EXTERN_API_C( TQAError )
  1483. QARegisterDrawNotificationProc    (Rect *                    globalRect,
  1484.                                  TQADrawNotificationProcPtr  proc,
  1485.                                  long                     refCon,
  1486.                                  TQADrawNotificationProcRefNum * refNum);
  1487.  
  1488. EXTERN_API_C( TQAError )
  1489. QAUnregisterDrawNotificationProc (TQADrawNotificationProcRefNum  refNum);
  1490.  
  1491. #endif  /* TARGET_OS_MAC */
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500. #if PRAGMA_ENUM_ALWAYSINT
  1501.     #pragma enumsalwaysint reset
  1502. #elif PRAGMA_ENUM_OPTIONS
  1503.     #pragma option enum=reset
  1504. #elif defined(PRAGMA_ENUM_PACK__RAVE__)
  1505.     #pragma options(pack_enums)
  1506. #endif
  1507.  
  1508. #if PRAGMA_STRUCT_ALIGN
  1509.     #pragma options align=reset
  1510. #elif PRAGMA_STRUCT_PACKPUSH
  1511.     #pragma pack(pop)
  1512. #elif PRAGMA_STRUCT_PACK
  1513.     #pragma pack()
  1514. #endif
  1515.  
  1516. #ifdef PRAGMA_IMPORT_OFF
  1517. #pragma import off
  1518. #elif PRAGMA_IMPORT
  1519. #pragma import reset
  1520. #endif
  1521.  
  1522. #ifdef __cplusplus
  1523. }
  1524. #endif
  1525.  
  1526. #endif /* __RAVE__ */
  1527.  
  1528.